package com.lggry.staticfield;

public class Test {
    public static void main(String[] args) {
        //目标：认识static修饰成员变量，特点，访问机制，作用。
        Student.name = "张三";
        System.out.println(Student.name);

        //2.对象名，静态变量（不推荐）
        Student stu1 = new Student();
        stu1.name = "李四";
        stu1.age  = 16;

        Student stu2 = new Student();
        stu2.name = "王五";
        stu2.age = 20;

        System.out.println(stu1.name  + "," + stu1.age);
        System.out.println(stu2.name  + "," + stu2.age);
        System.out.println(Student.name);
    }

}
